import request from "@/utils/request";

// 查询抽样方案列表
export function listSamplescheme(query) {
  return request({
    url: "/mes/qc/samplescheme/list",
    method: "get",
    params: query,
  });
}

// 查询抽样方案详细
export function getSamplescheme(id) {
  return request({
    url: "/mes/qc/samplescheme/" + id,
    method: "get",
  });
}

//同步抽样方案数据
// export function getJdySamplescheme(query) {
//   return request({
//     url: "/mes/k3cloud/api/quality/syncSampleschemeList",
//     method: "get",
//     params: query,
//   });
// }

export function getJdySamplescheme(query) {
  return request({
    url: "/sync/k3cloud/api/syncQcQmInspectitem/syncQcQmInspectitem",
    method: "get",
    params: query,
  });
}

// 新增抽样方案
export function addSamplescheme(data) {
  return request({
    url: "/mes/qc/samplescheme",
    method: "post",
    data: data,
  });
}

// 修改抽样方案
export function updateSamplescheme(data) {
  return request({
    url: "/mes/qc/samplescheme",
    method: "put",
    data: data,
  });
}

// 删除抽样方案
export function delSamplescheme(id) {
  return request({
    url: "/mes/qc/samplescheme/" + id,
    method: "delete",
  });
}
